package qhLoading.info 
{
	
	import flash.display.*;
	
	import qhLoading.QhLoadItem;
	
	/**
	 * ...
	 * @author gcxk721
	 */
	public class ImageInfo extends ResourceInfo 
	{
		
		private var _bitmapData : BitmapData;

        public function ImageInfo(item : QhLoadItem = null)
        {
            super(item);
        }

        public function get bitmapData() : BitmapData
        {
            return this._bitmapData;
        }

        override public function set data(value : Object) : void
        {
            super.data = value;
            this._bitmapData = value as BitmapData;
        }

        override public function dispose() : void
        {
			if(_bitmapData != null)
			{
				_bitmapData.dispose();
			}
            this._bitmapData = null;
            isLoaded = false;
            isLoading = false;
            super.dispose();
        }

        override protected function unload(loaderInfo : LoaderInfo) : void
        {
            var bitmap : Bitmap = loaderInfo.content as Bitmap;
            if (bitmap != null && bitmap.bitmapData != null)
            {
                bitmap.bitmapData.dispose();
                bitmap.bitmapData = null;
            }
            bitmap = null;
            super.unload(loaderInfo);
        }
	}

}